<template>
  <div class="attributes">
    <div class="item" v-for="item in specificationsList" :key="item.name" v-show="item.name != '售后服务'">
      <div class="line" v-if="item.type === 1">
        <div class="name">{{item.name}}</div>
        <div class="value" v-html="item.value "></div>
      </div>
      <div class="line2" v-else>
        <div class="name">{{item.name}}</div>
        <div class="sub_line" v-for="sitem in item.content" :key="sitem.name">
          <div class="tpye1" v-if="sitem.type === 1">
            <div class="sname">{{sitem.name}}</div>
            <div class="svalue" v-if="sitem.remark !== ''" v-html="sitem.value + '(备注：' + sitem.remark + ')'"></div>
            <div class="svalue" v-else v-html="sitem.value"></div>
          </div>
          <div class="tpye0" v-else>
            <div class="name">{{sitem.name}}</div>
            <div class="sub_line2" v-for="ssitem in sitem.content" :key="ssitem.name">
              <div class="sname">{{ssitem.name}}</div>
              <div class="svalue" v-if="ssitem.remark !== ''" v-html="ssitem.value + '(备注：' + ssitem.remark + ')'"></div>
              <div class="svalue" v-else v-html="ssitem.value"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="closeBtn" @click="cloesAttributesBtnClick"></div>
  </div>
</template>

<script>
export default {
  name: 'attributes',
  props: {
    specificationsList: Array, // 评分
  },
  data () {
    return {
      
    }
  },
  methods: {
    cloesAttributesBtnClick(){

    }
  }
}
</script>
<style lang="scss">
.attributes{
  z-index: 100;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 32px 20px;
  overflow-y: scroll;
  background-color: white;
  text-align: left;
  .item{
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 40px;
    font-size: 24px;
    word-break: break-all;
    &:last-of-type{
      border-bottom: none;
    }
    .line{
      .name{
        color: #333;
        font-weight: bold;
        font-size: 36px;
        padding: 32px 0;
      }
      .value{
        color: rgb(51,51,51);
      }
    }
    .line2{
      margin-bottom: 25px;
      line-height: 30px;
      .name{
        color: #333;
        font-weight: bold;
        font-size: 36px;
        padding: 32px 0;
      }
      .sub_line{
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        flex-wrap: nowrap;
        margin-bottom: 25px;
        line-height: 30px;
        .tpye1{
          display: flex;
          flex-direction: row;
          justify-content: flex-start;
          flex-wrap: nowrap;
          .sname{
            color: #999;
            margin-right: 4px;
            width: 170px;
          }
          .svalue{
            color: #333;
            width: 506px;
          }
        }
        .tpye0{
          .name{
            color: #333;
            font-weight: bold;
            font-size: 32px;
            padding: 25px 0;
          }
          .sub_line2{
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            flex-wrap: nowrap;
            margin-bottom: 25px;
            line-height: 30px;
            .sname{
              color: #999;
              margin-right: 4px;
              width: 170px;
            }
            .svalue{
              color: #333;
              width: 506px;
            }
          }
        }
      }
    }
  }
  .closeBtn{
    position: fixed;
    right: 32px;
    top: 36px;
    width: 36px;
    height: 36px;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 36px 36px;
    background-image: url(../../../../static/images/icon_ecWap_close.png);
  }
}
</style>